/**
 * 
 */
package org.chungyan5.flashcard;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author yan
 *
 */
public class Num implements Lesson {

	private int cnt = 21;
	private int startingValue;

	public Num(int startingValue) {
		this.startingValue = startingValue;  
	}

	public Num(Parcel source) {
		cnt = source.readInt();
		startingValue = source.readInt();
	}

	@Override
	public int getCnt() {
		return cnt;
	}

	@Override
	public String convert(int index) {
        // general 0,1,2 ... in seq. 
		return Integer.toString(index + startingValue);
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(cnt);
		dest.writeInt(startingValue);
	}

	/**
	 * It will be required during un-marshaling data stored in a Parcel
	 * @author prasanta
	 */
	public static final Parcelable.Creator<Num> CREATOR = new Parcelable.Creator<Num>() {  
	    
        public Num createFromParcel(Parcel in) {  
            return new Num(in);  
        }  
   
        public Num[] newArray(int size) {  
            return new Num[size];  
        }  
          
    };
}
